//
//  PALViewController.m
//  Palabris
//
//  Created by Sven Schönung on 11/28/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import "PALMainViewController.h"
#import "PALUserViewController.h"
#import "PALGameViewController.h"
#import "PALHighscoreViewController.h"

@implementation PALMainViewController

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
	[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
	[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation != UIInterfaceOrientationLandscapeLeft) &&
            (interfaceOrientation != UIInterfaceOrientationLandscapeRight);
}

- (IBAction)userButtonClicked:(id)sender {
    PALUserViewController *userViewController = [[[PALUserViewController alloc] initWithNibName:@"PALUserViewController" bundle:nil] autorelease];
    
    [self.navigationController pushViewController:userViewController animated:NO];
}

- (IBAction)startGameButtonClicked:(id)sender {
    PALGameViewController *gameViewController = [[[PALGameViewController alloc] initWithNibName:@"PALGameViewController" bundle:nil] autorelease];
    
    [self.navigationController pushViewController:gameViewController animated:NO];
}

- (IBAction)highscoreButtonClicked:(id)sender {
    PALHighscoreViewController *highscoreViewController = [[[PALHighscoreViewController alloc] initWithNibName:@"PALHighscoreViewController" bundle:nil] autorelease];
    
    [self.navigationController pushViewController:highscoreViewController animated:NO];
}
@end
